f42c8cf69c65d8081ba922531a01631d78daf9e4,source/de/anomic/plasma/plasmaWebStructure.java,plasmaWebStructure,referencesCount,#String#,231

Before Change


    public int referencesCount(String domhash) {
        // returns the number of domains that are referenced by this domhash
        assert domhash.length() == 6 : "domhash = " + domhash;
        synchronized(structure) {
            SortedMap<String, String> tailMap = structure.tailMap(domhash);
            if ((tailMap == null) || (tailMap.isEmpty())) return 0;
            String key = tailMap.firstKey();
            if (key.startsWith(domhash)) {
                return refstr2count(tailMap.get(key));
            } else {
                return 0;
            }
        }
    }

After Change


        assert domhash.length() == 6 : "domhash = " + domhash;
        SortedMap<String, String> tailMap;
        int c = 0;
        synchronized (structure_old) {
            tailMap = structure_old.tailMap(domhash);
            if (!tailMap.isEmpty()) {
                String key = tailMap.firstKey();
                if (key.startsWith(domhash)) {
                    c = refstr2count(tailMap.get(key));
                }
            }
        }
        synchronized (structure_new) {
            tailMap = structure_new.tailMap(domhash);
            if (!tailMap.isEmpty()) {
                String key = tailMap.firstKey();
                if (key.startsWith(domhash)) {
                    c += refstr2count(tailMap.get(key));
                }
            }